import {useCallback, useState} from "react";

export default () => {
  const [token, setToken] = useState("")
  const login = useCallback((tokenStr: string) => setToken(tokenStr), [])
  const logout = useCallback(() => setToken(""), [])

  return {
    token,
    login,
    logout
  }
}
